package com.hkd.product_service.api.fallback;

import com.hkd.common.api.ApiResponse;
import com.hkd.common.api.BaseFallBack;
import com.hkd.common.api.BaseFallbackFactory;
import com.hkd.product_service.api.ProductPicInfoService;
import com.hkd.product_service.api.ProductSpecsService;
import com.hkd.product_service.api.entity.ProductSpecs;

import java.util.List;

/**
 * @author HKD
 * @date 2022/9/17 23:11
 */
public class ProductSpecsServiceImplFallback extends BaseFallbackFactory<ProductSpecsService> {

    @Override
    public ProductSpecsService create(Throwable throwable) {
        FeignFallback fallback = new FeignFallback();
        fallback.setCause(throwable);
        return fallback;
    }
    public class FeignFallback extends BaseFallBack implements ProductSpecsService {
        @Override
        public ApiResponse<Integer> specsSaveBatch(List<ProductSpecs> specs) {
            return defaultFallBack();
        }
    }
}
